#include <stdio.h>

int sum(int arr[], int n) {
  int res;
  for (int i = 0; i < n; i++) {
    res += *(arr + i);
  }
  return res;
}

int main() {
  int arr[5] = {1, 2, 3, 4, 5};
  int result = sum(arr, 5);
  printf("%d", result);
}